﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace VkVideoPlayer.UI.Services
{
	public class VKNavigationService : INavigationService
	{
		public void NavigatToAuthorizationPage()
		{
			NavigateTo("/AuthPage.xaml");
		}

		public void NavigateToHomePage()
		{
			NavigateTo("/MainPage.xaml");
		}

		public void NavigateToVideosPage()
		{
			NavigateTo("/VideosPage.xaml");
		}

		private PhoneApplicationFrame phoneApplicationFrame
		{
			get
			{
				return (Application.Current.RootVisual as PhoneApplicationFrame);
			}
		}

		private void NavigateTo(string urlTemplate, params string[] values)
		{
			var url = String.Format(urlTemplate, values);
			phoneApplicationFrame.Navigate(new Uri(url, UriKind.Relative));
		}
	}
}
